package com.bigdata.es;

import java.util.concurrent.*;

public class FutureDemo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {

        Task task = new Task();
        task.addListener(new Listener<String>() {
            @Override
            public void notify(String s) {
                System.out.println("listener: " + s);
                MyThreadPool.single.shutdown();
            }
        });
        MyThreadPool.single.submit(task);
    }
}
